package com.auxgroup.smarthome.service.inner;

import com.auxgroup.smarthome.service.DeviceInfoInnerServiceFallback;
import com.auxgroup.smarthome.web.ApiResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by niuGuangzhe on 2017/8/24.
 */
@FeignClient(name = "INNER-SERVICE",fallback = DeviceInfoInnerServiceFallback.class)
public interface DeviceModelInfoInnerService {

    /**
     *  到达定时时间之后调用拉取mes系统数据到本地，不需要考虑是否成功只要关注发送成功即可
     *  时间可能会很长，估计一次请求时间来回需要大约五分钟，服务会被降级导致不成功
     * @param date
     * @return
     */
    //todo 服务调用时间过长导致的服务降级
    @RequestMapping(value = "/inner/insert_sn_mapping",method = RequestMethod.GET)
    ApiResponse igniteFuse(@RequestParam("date") String date);
}
